var t = getApp();

Page({
    data: {
        text: "",
        text1: "¹³⁸ºººººººº",
        text2: "₁₃₈₀₀₀₀₀₀₀₀",
        up: [ "º", "¹", "²", "³", "⁴", "⁵", "⁶", "⁷", "⁸", "⁹" ],
        down: [ "₀", "₁", "₂", "₃", "₄", "₅", "₆", "₇", "₈", "₉" ],
        spAd_01: t.ad.spAd_01
    },
    onLoad: function() {},
    onShow: function() {},
    onShareAppMessage: function(t) {
        return this.setData({
            text: ""
        }), this.textInput({
            detail: {
                value: ""
            }
        }), {
            title: "上下标数字 - 使昵称更具特色"
        };
    },
    textInput: function(t) {
        if ("" != t.detail.value) {
            var e = this, a = "", n = "";
            t.detail.value.split("").forEach(function(t) {
                [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ].indexOf(Number(t)) >= 0 ? a += e.data.up[t] : a += t, 
                [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 ].indexOf(Number(t)) >= 0 ? n += e.data.down[t] : n += t;
            }), this.setData({
                text1: a,
                text2: n
            });
        } else this.setData({
            text1: "¹³⁸ºººººººº",
            text2: "₁₃₈₀₀₀₀₀₀₀₀"
        });
    },
    copy: function(t) {
        var e = t.currentTarget.dataset.text;
        wx.setClipboardData({
            data: e,
            success: function(t) {
                wx.getClipboardData({
                    success: function(t) {
                        console.log(t.data);
                    }
                });
            }
        });
    }
});